import {RouteRecordRaw} from 'vue-router'
import {RouterAllName} from '@/utils/routerAllName'

// 白名单路由
const whiteRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: "login",
    component: () => import('@/pages/login/login.vue'),
  },
  {
    path: '/register',
    name: "register",
    component: () => import('@/pages/register/register.vue'),
  }
]
// 白名单路由名称
const list: string[] = []
export const routes: RouteRecordRaw[] = [
  ...whiteRoutes,
  {
    path: '/',
    name: "layout",
    component: () => import('@/layout/index.vue'),
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import('@/pages/home/home.vue'),
        meta: {
          title: "首页",
          icon: "HomeFilled"
        }
      }
    ]
  },
  {
    path: '/system',
    name: "system",
    component: () => import('@/layout/index.vue'),
    meta: {
      title: "系统管理",
      icon: "Tools"
    },
    children: [
      {
        path: "/system/user",
        name: "user",
        component: () => import('@/pages/system/user/User.vue'),
        meta: {
          title: "用户管理",
          icon: "UserFilled"
        }
      },
      {
        path: "/system/role",
        name: "role",
        component: () => import('@/pages/system/role/Role.vue'),
        meta: {
          title: "角色管理",
          icon: "MoreFilled"
        }
      },
      {
        path: "/system/menu",
        name: "menu",
        component: () => import('@/pages/system/menu/Menu.vue'),
        meta: {
          title: "菜单管理",
          icon: "Menu"
        }
      },
      {
        path: "/system/dict",
        name: "dict",
        component: () => import('@/pages/system/dict/Dict.vue'),
        meta: {
          title: "字典管理",
          icon: "Menu"
        }
      },
      {
        path: "/system/dict-value",
        name: "dictValue",
        component: () => import('@/pages/system/dictValue/DictValue.vue'),
        meta: {
          title: "字典数据",
          icon: "Menu"
        }
      }
    ]
  }
]

RouterAllName(whiteRoutes, list)

export default list
